package com.ruoyi.project.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.TaskRecipientsMapper;
import com.ruoyi.project.system.domain.TaskRecipients;
import com.ruoyi.project.system.service.ITaskRecipientsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 任务与接收人关联Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-16
 */
@Service
public class TaskRecipientsServiceImpl implements ITaskRecipientsService 
{
    @Autowired
    private TaskRecipientsMapper taskRecipientsMapper;

    /**
     * 查询任务与接收人关联
     * 
     * @param taskId 任务与接收人关联主键
     * @return 任务与接收人关联
     */
    @Override
    public TaskRecipients selectTaskRecipientsByTaskId(Long taskId)
    {
        return taskRecipientsMapper.selectTaskRecipientsByTaskId(taskId);
    }

    /**
     * 查询任务与接收人关联列表
     * 
     * @param taskRecipients 任务与接收人关联
     * @return 任务与接收人关联
     */
    @Override
    public List<TaskRecipients> selectTaskRecipientsList(TaskRecipients taskRecipients)
    {
        return taskRecipientsMapper.selectTaskRecipientsList(taskRecipients);
    }

    /**
     * 新增任务与接收人关联
     * 
     * @param taskRecipients 任务与接收人关联
     * @return 结果
     */
    @Override
    public int insertTaskRecipients(TaskRecipients taskRecipients)
    {
        return taskRecipientsMapper.insertTaskRecipients(taskRecipients);
    }

    /**
     * 修改任务与接收人关联
     * 
     * @param taskRecipients 任务与接收人关联
     * @return 结果
     */
    @Override
    public int updateTaskRecipients(TaskRecipients taskRecipients)
    {
        return taskRecipientsMapper.updateTaskRecipients(taskRecipients);
    }

    /**
     * 批量删除任务与接收人关联
     * 
     * @param taskIds 需要删除的任务与接收人关联主键
     * @return 结果
     */
    @Override
    public int deleteTaskRecipientsByTaskIds(String taskIds)
    {
        return taskRecipientsMapper.deleteTaskRecipientsByTaskIds(Convert.toStrArray(taskIds));
    }

    /**
     * 删除任务与接收人关联信息
     * 
     * @param taskId 任务与接收人关联主键
     * @return 结果
     */
    @Override
    public int deleteTaskRecipientsByTaskId(Long taskId)
    {
        return taskRecipientsMapper.deleteTaskRecipientsByTaskId(taskId);
    }
}
